//This Javascript is used to put the value of the form to a session form
//require to include jquery.js
//require to include jquery.form.js
var g_api_for_update_session_form;
function sessionform_enable(api_for_update_session_form){
	insertSetValueEventHandler($(":button[name='sendButton1']")[0]);
	insertSetValueEventHandler($(":button[name='sendButton2']")[0]);
	g_api_for_update_session_form=api_for_update_session_form;
}
function insertSetValueEventHandler(buttonObj){
	if(buttonObj==null)
		return;
	var func= buttonObj.onclick;
	$(buttonObj).removeAttr('onclick');
	$(buttonObj).bind('click',function(){
		updateFormToSession(func);
	});
}
function updateFormToSession(func){
//This function will upload the values of the form to the serverside as a template
	var options={url:g_api_for_update_session_form,type:'post',success:func};
	$("form").ajaxSubmit(options);
}